package com.stylefeng.guns.modular.salesmanagement.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.modular.dto.GoodsSaleAddRequest;
import com.stylefeng.guns.modular.dto.SaleGoodsQueryRequest;
import com.stylefeng.guns.modular.system.model.GoodsSale;
import com.baomidou.mybatisplus.service.IService;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author LiuXin
 * @since 2018-09-12
 */
public interface IGoodsSaleService extends IService<GoodsSale> {

    /**
     * 插入销售单据和销售库存
     * @param request 请求
     * @return true false
     */
    boolean insertGoodSaleAndGoods(GoodsSaleAddRequest request);

    /**
     * 根据id删除订单和商品
     * @param goodsSaleId 订单id
     * @return true false
     */
    boolean deleteGoodSaleAndGoods(Long goodsSaleId);

    /**
     * 查找分页和数据范围
     * @param page 分页
     * @param request 请求
     * @return 结果集
     */
    Page<GoodsSale> selectPageWithDataScope(Page<GoodsSale> page, SaleGoodsQueryRequest request);

}
